/*
 * XML Type:  results
 * Namespace: 
 * Java type: com.guardianapis.api.domain.xmlbeans.Results
 *
 * Automatically generated - do not modify.
 */
package com.guardianapis.api.domain.xmlbeans.impl;
/**
 * An XML results(@).
 *
 * This is a complex type.
 */
public class ResultsImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.guardianapis.api.domain.xmlbeans.Results
{
    private static final long serialVersionUID = 1L;
    
    public ResultsImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CONTENT$0 = 
        new javax.xml.namespace.QName("", "content");
    
    
    /**
     * Gets array of all "content" elements
     */
    public com.guardianapis.api.domain.xmlbeans.Content[] getContentArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CONTENT$0, targetList);
            com.guardianapis.api.domain.xmlbeans.Content[] result = new com.guardianapis.api.domain.xmlbeans.Content[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "content" element
     */
    public com.guardianapis.api.domain.xmlbeans.Content getContentArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Content target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Content)get_store().find_element_user(CONTENT$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "content" element
     */
    public int sizeOfContentArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CONTENT$0);
        }
    }
    
    /**
     * Sets array of all "content" element
     */
    public void setContentArray(com.guardianapis.api.domain.xmlbeans.Content[] contentArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(contentArray, CONTENT$0);
        }
    }
    
    /**
     * Sets ith "content" element
     */
    public void setContentArray(int i, com.guardianapis.api.domain.xmlbeans.Content content)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Content target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Content)get_store().find_element_user(CONTENT$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(content);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "content" element
     */
    public com.guardianapis.api.domain.xmlbeans.Content insertNewContent(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Content target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Content)get_store().insert_element_user(CONTENT$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "content" element
     */
    public com.guardianapis.api.domain.xmlbeans.Content addNewContent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Content target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Content)get_store().add_element_user(CONTENT$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "content" element
     */
    public void removeContent(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CONTENT$0, i);
        }
    }
}
